
package SSF.Net;

import SSF.Util.Streams.*;

import java.io.*;

// Something you might use to decode the info emitted by droptailQueue...

public class nicDecoder extends BasicPlayer {

    int mytype = -1;
    boolean first = true;

    public nicDecoder(String streamID) {
	super(streamID);
    }

    public int receive(int typecode, int sourcecode, double time, 
			byte[] bytes, int off, int len) {

	if (first) {
	    first = false;
	    mytype = getRecordTypeCode("SSF.Net.nicDecoder");
	}

	if (typecode == mytype) 
	    try {
		System.err.println("Buffer capacity %"+new String(bytes,off,len)+
				   "\tt="+time+"\tnhi "+
				   (getRecordSourceString(sourcecode)));
		return 0;
	    } catch (Exception any) {
		any.printStackTrace(); // stub
		return -1;
	    }
	else 
	    return super.receive(typecode,sourcecode,time,bytes,off,len);
    }
}
